home *** CD-ROM | disk | FTP | other *** search
- s32 IniHPLink(mcString doorId, s32 nbLink, s32 idlink1,s32 idlink2,s32 idlink3,s32 idlink4 )
- {
- mcString recid;
- s32 linkindice;
-
- linkindice = 0;
- recid = doorId + "_LINKID";
-
- SetVariable(doorId + "_NBLINK",nbLink);
-
- if( (idlink1 != -1) && (linkindice < nbLink) )
- {
- AddVariable(recId + linkindice,idlink1);
- linkindice += 1;
- }
- else
- return 0;
-
- if( (idlink2 != -1 ) && (linkindice < nbLink) )
- {
- AddVariable(recId + linkindice,idlink2);
- linkindice += 1;
- }
- else
- return 0;
-
- if( (idlink3 != -1 ) && (linkindice < nbLink) )
- {
- AddVariable(recId + linkindice ,idlink3);
- linkindice += 1;
- }
- else
- return 0;
-
- if( (idlink4 != -1 ) && (linkindice < nbLink) )
- {
- AddVariable(recId + linkindice,idlink4);
- linkindice += 1;
- }
- else
- return 0;
-
- return 0;
- }
-
-
- s32 CheckLink(mcString PorteName, s32 Id, s32 Sens)
- {
- s32 nbLink;
- s32 indice;
- mcString doorid;
- mcString linkid;
-
- doorid = PorteName + Id;
- nbLink = GetVariable(doorid + "_NBLINK");
-
- if( nbLink != 0 )
- {
- linkid = doorid + "_LINKID";
- for ( indice = 0; indice < nbLink; indice += 1 )
- {
- SetHotpointLinkActivated(GetVariable(linkid + indice) ,Sens);
- }
- }
-
- return 0;
- }
-
- s32 CheckBigFire(s32 IDSource, s32 IDToCheck, f32 seuil)
- {
- if( GetTimeSim() > 0 )
- {
- s32 SourceFireStarter;
- s32 SeuilFeuGround;
- f32 seuil_tot;
- f32 CHP;
- f32 MHP;
- f32 CheckHP;
-
- SourceFireStarter = IsHotPointActivated(IDSource);
-
- if( SourceFireStarter == 1 )
- {
- CHP = GetHotPointHP(IDSource);
- MHP = GetHotPointMHP(IDSource);
-
- seuil_tot = MHP*seuil/100.0;
-
- if( CHP > seuil_tot )
- {
- CheckHP = GetHotPointHP(IDToCheck);
- if( CheckHP <= 0.0 )
- {
- SetHotPointHP(IDToCheck,1.0);
- return 0;
- }
- }
-
- }
- }
-
- return -1;
- }
-
- s32 HPONOFF(mcString IdBase,s32 nbhp, s32 OnOff )
- {
- s32 indice;
- s32 id;
-
- for( indice = 0; indice < nbhp; indice +=1 )
- {
- id = GetVariable(IdBase + indice);
- SetHotpointActivated( id, OnOff);
- }
-
- return 0;
- }
-
-
- s32 TestHPstarted(mcString IdBase,s32 nbhp)
- {
- s32 indice;
- s32 id;
-
- for( indice = 0; indice < nbhp; indice +=1 )
- {
- id = GetVariable(IdBase + indice);
- if( GetHotpointHP(id) > 0.0 )
- return 0;
- }
-
- return 1;
-
- }
-
-